home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_nub_commie_grid.cog < prev    next >
Text File  |  1999-11-15  |  23KB  |  800 lines

  1.  
  2. # Jones 3D Cog Script
  3. #
  4. # NUB_Commie_Grid.cog
  5. # Cog to control the AI and patrol behavior of the commies in Nub's tomb
  6. #
  7. # [JM]
  8. #
  9. # (C) 1999 LucasArts Entertainment Company LLC. All Rights Reserved
  10. #
  11. # ========================================================================================
  12. symbols
  13.  
  14. message         startup
  15. message         crossed                                          
  16. message         killed
  17. message         entered
  18. message         damaged
  19. message         User0
  20. message         User1
  21. message         User2
  22. message         User3
  23. message         User4
  24. message         User5
  25. message         arrivedwpnt
  26.  
  27. # =============================== SUBROUTINES ================================
  28.  
  29. flex            MakeMainGrid    local
  30. flex            MakeLabGrid     local
  31.  
  32. flex            EnablePillarAI  local
  33. flex            DisablePillarAI local
  34.  
  35. flex            EnableElevAI    local
  36. flex            DisableElevAI   local
  37.  
  38. flex            EnableLabAI     local
  39. flex            DisableLabAI    local
  40.  
  41. flex            RubbleAIOn      local
  42. flex            RubbleAIOff     local
  43.  
  44. # ============================ MISC LOCAL VARIABLES ==========================
  45.  
  46. int             counter         local
  47. int             SwitchCheck=0   local
  48.  
  49. int             PillarAIActivated=0     local
  50. int             TakingRubble=0          local       #this is if the player goes back through start instead of lowering the coffin... after getting the Anubis arm that is
  51.  
  52. int             User4Done=0             local
  53. int             Lab01Arrived=0          local
  54. int             Lab02Arrived=0          local
  55.  
  56. int             AfterVolod=0            local
  57. int             AlreadyHunted=0         local
  58.  
  59. # =========================== WORLD GEOMETRY REFERENCES ======================
  60.  
  61. surface         EnableLab00         LinkID=1
  62. surface         EnableLab01         LinkID=1
  63. surface         DisableLab00        LinkID=2
  64. surface         DisableLab01        LinkID=2
  65.  
  66. surface         EnableMain00        LinkID=3
  67. surface         EnableMain01        LinkID=3
  68. surface         DisableMain00       LinkID=4
  69. surface         DisableMain01       LinkID=4
  70.  
  71. thing           RubbleTeleporter00  
  72. thing           RubbleTeleporter01
  73. thing           RubbleTeleporter02
  74.  
  75. surface         RubbleRouteOn       
  76. surface         RubbleRouteOff 
  77.  
  78. sector          AfterVolodAttack0   LinkID=5
  79. sector          AfterVolodAttack1   LinKID=5
  80. sector          AfterVolodAttack2   LinKID=5
  81.  
  82. thing           CommieCreate0
  83. thing           CommieCreate1
  84. thing           CommieCreate2
  85.  
  86. # =============================== CONSTANTS ==================================
  87.  
  88. int             WAYPOINT_TOTAL_MAIN=43      local
  89. int             WAYPOINT_TOTAL_LAB=28       local
  90.  
  91. int             WAYPOINT_CLEAR=60           local
  92.  
  93. int             TOTAL_COMMIES=16            local
  94.  
  95. int             NUMBER_OF_COMMIES_LAB=3     local
  96. int             NUMBER_OF_COMMIES_PILLAR=6  local
  97. int             NUMBER_OF_COMMIES_ELEV=7    local
  98. int             NUMBER_OF_ROBOTS=2          local
  99.  
  100. int             COMMIE_ONE_FLEE_TO_WPNT=27  local
  101. int             COMMIE_TWO_FLEE_TO_WPNT=6   local
  102.  
  103. int             NUMBER_COMMIES_AFTER_VOLOD=3    local
  104.  
  105. # =============================== COMMIES ====================================
  106.  
  107. thing           TempCurWpnt             local
  108. thing           TempCommie              local
  109.  
  110. thing           CommieLab00=-1          local
  111. thing           CommieLab01=-1          local
  112. thing           CommieLab02=-1          local
  113.  
  114. thing           CommiePillar00=-1       local
  115. thing           CommiePillar01=-1       local
  116. thing           CommiePillar02=-1       local
  117. thing           CommiePillar03=-1       local
  118. thing           CommiePillar04=-1       local
  119. thing           CommiePillar05=-1       local
  120.  
  121. thing           CommieElev00=-1         local
  122. thing           CommieElev01=-1         local
  123. thing           CommieElev02=-1         local
  124. thing           CommieElev03=-1         local
  125.  
  126. thing           AfterVolodCommie0=-1    local
  127. thing           AfterVolodCommie1=-1    local
  128. thing           AfterVolodCommie2=-1    local
  129.  
  130. #thing           SpinnerRobot00      
  131. #thing           SpinnerRobot01      
  132.  
  133. # ============================= WAYPOINTS - THE GRID =========================
  134.  
  135. thing           TempWpnt 
  136.  
  137. thing           Wpnt00
  138. thing           Wpnt01
  139. thing           Wpnt02
  140. thing           Wpnt03
  141. thing           Wpnt04
  142. thing           Wpnt05
  143. thing           Wpnt06
  144. thing           Wpnt07
  145. thing           Wpnt08
  146. thing           Wpnt09
  147. thing           Wpnt10
  148. thing           Wpnt11
  149. thing           Wpnt12
  150. thing           Wpnt13
  151. thing           Wpnt14
  152. thing           Wpnt15
  153. thing           Wpnt16
  154. thing           Wpnt17
  155. thing           Wpnt18
  156. thing           Wpnt19
  157. thing           Wpnt20
  158. thing           Wpnt21
  159. thing           Wpnt22
  160. thing           Wpnt23
  161. thing           Wpnt24
  162. thing           Wpnt25
  163. thing           Wpnt26
  164. thing           Wpnt27
  165. thing           Wpnt28
  166. thing           Wpnt29
  167. thing           Wpnt30
  168. thing           Wpnt31
  169. thing           Wpnt32
  170. thing           Wpnt33
  171. thing           Wpnt34
  172. thing           Wpnt35
  173. thing           Wpnt36
  174. thing           Wpnt37
  175. thing           Wpnt38
  176. thing           Wpnt39
  177. thing           Wpnt40
  178. thing           Wpnt41
  179. thing           Wpnt42
  180.  
  181. thing           LabWpnt00
  182. thing           LabWpnt01
  183. thing           LabWpnt02
  184. thing           LabWpnt03
  185. thing           LabWpnt04
  186. thing           LabWpnt05
  187. thing           LabWpnt06
  188. thing           LabWpnt07
  189. thing           LabWpnt08
  190. thing           LabWpnt09
  191. thing           LabWpnt10
  192. thing           LabWpnt11
  193. thing           LabWpnt12
  194. thing           LabWpnt13
  195. thing           LabWpnt14
  196. thing           LabWpnt15
  197. thing           LabWpnt16
  198. thing           LabWpnt17
  199. thing           LabWpnt18
  200. thing           LabWpnt19
  201. thing           LabWpnt20
  202. thing           LabWpnt21
  203. thing           LabWpnt22
  204. thing           LabWpnt23
  205. thing           LabWpnt24
  206. thing           LabWpnt25
  207. thing           LabWpnt26
  208. thing           LabWpnt27
  209.  
  210. # ============================= TEMPLATES ====================================
  211. template        ShotgunGuy0=khaki_shotgun4      local
  212. template        ShotgunGuy1=khaki_shotgun3      local
  213. template        Bruiser=bruiser                 local
  214.  
  215. sound           Yell0=Inxh3019.wav        local
  216. sound           Yell1=Inxh2019.wav        local
  217.                 
  218. # ============================================================================
  219.  
  220. end 
  221.  
  222. # ============================================================================
  223. # ================================= CODE =====================================
  224. # ============================================================================
  225. code
  226. # ============================================================================
  227. startup:
  228.  
  229.     Call MakeMainGrid;
  230.  
  231.     return;
  232.     
  233. # ============================================================================
  234. crossed:
  235.  
  236.     if(GetSenderID() == 3)
  237.     {
  238.         Call MakeMainGrid;
  239.         
  240.         Call EnableElevAI;
  241.         Call EnablePillarAI;
  242.     }
  243.     
  244.     else if(GetSenderID() == 4)
  245.     {
  246.         Call DisableElevAI;
  247.         Call DisablePillarAI;
  248.     }
  249.     
  250.     else if(GetSenderID() == 1)
  251.     {
  252.         
  253.         Call DisablePillarAI;
  254.         
  255.         Call DisableElevAI;
  256.         
  257.         Call MakeLabGrid;
  258.         
  259.         if(SwitchCheck == 1)
  260.         {
  261.             Call EnableLabAI;  
  262.         }
  263.     }        
  264.     
  265.     else if(GetsenderID() == 2)
  266.     {
  267.         if(SwitchCheck == 1)
  268.         {
  269.             Call DisableLabAI;
  270.         }
  271.         
  272.         Call MakeMainGrid;
  273.         
  274.         Call EnableElevAI;
  275.         
  276.         Call EnablePillarAI;
  277.     }
  278.         
  279.     else if(GetSenderRef() == RubbleRouteOff)
  280.     {
  281.         if(PillarAIActivated == 0) return;
  282.         if(TakingRubble != 1) return;
  283.                 
  284.         Call RubbleAIOff;
  285.     }
  286.  
  287.     return;
  288.  
  289. # ============================================================================
  290. killed:
  291.  
  292.     TempCommie = GetSenderRef();
  293.     
  294.     for(counter = 0; counter < TOTAL_COMMIES; counter = counter + 1)
  295.     {
  296.         if(CommieLab00[counter] == TempCommie)
  297.         {   
  298.             CommieLab00[counter] = -1;
  299.         }    
  300.     }    
  301.     
  302.     return;
  303.     
  304. # ============================================================================
  305. entered:
  306.  
  307.     if(GetSenderRef() == RubbleRouteOn)
  308.     {
  309.         if(PillarAIActivated == 0) return;
  310.         if(TakingRubble != 0) return;
  311.         
  312.         Call RubbleAIOn;
  313.     }
  314.     
  315.     else if(GetSenderID() == 5)
  316.     {
  317.         if(AfterVolod != 1) return;
  318.         
  319.         if(AlreadyHunted == 1) return;
  320.         
  321.         for(counter = 0; counter < NUMBER_COMMIES_AFTER_VOLOD; counter = counter + 1)
  322.         {
  323.             ClearActorFlags(AfterVolodCommie0[counter], 0x800);
  324.             ClearActorFlags(AfterVolodCommie0[counter], 0x400);
  325.             AIWpntHuntTarget(AfterVolodCommie0[counter], 1.5, 0.0);
  326.         }              
  327.         AlreadyHunted = 1;
  328.     }
  329.  
  330.     return;
  331.         
  332. # ======================================================
  333. damaged:
  334.  
  335.     if(TakingRubble != 1) return;
  336.     
  337.     Call RubbleAIOff;
  338.     
  339.     return;
  340. # ======================================================
  341. //Sent by NUB_Commie_Gen_ManagerX
  342. user0:
  343.     
  344.     //First param is the officer and the other two are the soldiers...
  345.     CommiePillar00 = GetParam(0);
  346.     CommiePillar01 = GetParam(1);
  347.     CommiePillar02 = GetParam(2);
  348.     
  349.     CaptureThing(CommiePillar00);
  350.     CaptureThing(CommiePillar01);
  351.     CaptureThing(CommiePillar02);
  352.     
  353.     sleep(1.0);  //just make sure that user1 get's recieved as well
  354.     
  355.     Call EnablePillarAI;
  356.     
  357.     PillarAIActivated = 1;
  358.     
  359.     return;
  360.     
  361. # ============================================================================
  362. //Sent by NUB_Commie_Gen_ManagerX
  363. user1:
  364.     
  365.     CommiePillar03 = GetParam(0);
  366.     CommiePillar04 = GetParam(1);
  367.     CommiePillar05 = GetParam(2);
  368.     
  369.     CaptureThing(CommiePillar03);
  370.     CaptureThing(CommiePillar04);
  371.     CaptureThing(CommiePillar05);
  372.     
  373.     return;    
  374.     
  375. # ============================================================================
  376. //Sent by the NUB_MazeSteps cog
  377. user2:
  378.     
  379.     for(counter = 0; counter < (NUMBER_OF_COMMIES_ELEV - NUMBER_COMMIES_AFTER_VOLOD); counter = counter + 1)
  380.     {
  381.         CommieElev00[counter] = Getparam(counter);
  382.         CaptureThing(CommieElev00[counter]);
  383.     }
  384.     
  385.     Call EnableElevAI;
  386.  
  387.     return;    
  388.     
  389. # ============================================================================
  390. //Sent by the Lightning cog in the Lab
  391. user3:
  392.  
  393.     for(counter = 0; counter < NUMBER_OF_COMMIES_LAB; counter = counter + 1)
  394.     {
  395.         CommieLab00[counter] = GetParam(counter);
  396.         CaptureThing(Commielab00[counter]);
  397.     }
  398.  
  399.     TeleportThing(CommieLab00, Labwpnt08);
  400.     TeleportThing(CommieLab01, LabWpnt27);
  401.     TeleportThing(CommieLab02, LabWpnt22);
  402.             
  403.     SwitchCheck = 1;
  404.     
  405.     Call EnableLabAI;
  406.     
  407.     return;
  408.  
  409. # ============================================================================
  410. //Sent by Lightning cog in the lab
  411. user4:
  412.  
  413.     Sleep(0.25);
  414.     
  415.     if(CommieLab01 != -1)
  416.     {
  417.     AISetLookThing(CommieLab01, LabWpnt02);
  418.     PlaySoundThing(Yell0, CommieLab01, 1.0, 10, 30, 0x0080);
  419.     }
  420.     
  421.     Sleep(0.25);
  422.     
  423.     if(CommieLab02 != -1)
  424.     {
  425.            AISetLookThing(CommieLab02, LabWpnt02);
  426.            PlaySoundThing(Yell1, CommieLab02, 1.0, 10, 30, 0x0080);
  427.     }
  428.  
  429.     Sleep(0.75);
  430.     
  431.     if(CommieLab01 != -1)
  432.     {
  433.         AISetSubMode(CommieLab01, 0x8000); // SITHAI_SUBMODECONTINUOUSWPNTMOTION. Required for FleeToWpnt
  434.         AIFleeToWpnt(CommieLab01, COMMIE_ONE_FLEE_TO_WPNT);
  435.     }
  436.     
  437.     if(CommieLab02 != -1)
  438.     {
  439.         AISetSubMode(CommieLab02, 0x8000); // SITHAI_SUBMODECONTINUOUSWPNTMOTION. Required for FleeToWpnt
  440.         AIFleeToWpnt(CommieLab02, COMMIE_TWO_FLEE_TO_WPNT);
  441.     }
  442.     
  443.     User4Done = 1;
  444.  
  445.     return;
  446.  
  447. # ============================================================================
  448. //Message recieved from Nub_Vol_cutscene.cog after stone gera has ben acquired from Volodnikov
  449. user5:           
  450.       
  451.     AfterVolodCommie0 = CreateThing(Bruiser, CommieCreate0);
  452.     AfterVolodCommie1 = CreateThing(ShotgunGuy0, CommieCreate1);
  453.     AfterVolodCommie2 = CreateThing(ShotgunGuy1, CommieCreate2);
  454.     
  455.     for(counter = 0; counter < NUMBER_COMMIES_AFTER_VOLOD; counter = counter + 1)
  456.     {
  457.         CaptureThing(AfterVolodCommie0[counter]);
  458.         SetActorFlags(AfterVolodCommie0[counter], 0x800);
  459.         SetActorFlags(AfterVolodCommie0[counter], 0x400);
  460.         AISetLookThing(AfterVolodCommie0[counter], wpnt29);
  461.         AISetInstinctWpntMode(AfterVolodCommie0[counter]);
  462.     }
  463.     
  464.     AfterVolod = 1;
  465.     
  466.     return;
  467.  
  468. # ============================================================================
  469. arrivedwpnt:
  470.  
  471.     if(User4Done == 0) return;
  472.     
  473.     if(GetSenderRef() == CommieLab01 && GetParam(0) == COMMIE_ONE_FLEE_TO_WPNT)
  474.     {   
  475.     if(CommieLab01 != -1)
  476.         {
  477.             AIStopFlee(CommieLab01);
  478.         AIClearSubMode(CommieLab01, 0x8000); // SITHAI_SUBMODECONTINUOUSWPNTMOTION. Was need for FleeToWpnt
  479.             
  480.             Lab01Arrived = 1;
  481.             
  482.             if(Lab02Arrived == 1) User4Done = 0;
  483.         }
  484.     }
  485.     
  486.     else if(GetSenderRef() == CommieLab00 && GetParam(0) == COMMIE_TWO_FLEE_TO_WPNT)
  487.     {
  488.         if(CommieLab02 != -1)
  489.         {
  490.             AIStopFlee(CommieLab02);
  491.         AIClearSubMode(CommieLab02, 0x8000); // SITHAI_SUBMODECONTINUOUSWPNTMOTION. Was need for FleeToWpnt
  492.             
  493.             Lab02Arrived = 1;
  494.             
  495.             if(Lab01Arrived == 1) User4Done = 0;
  496.         }
  497.     }
  498.  
  499.     return;
  500.             
  501. # ============================================================================
  502. # ============================= SUBROUTINES ==================================
  503. # ============================================================================
  504. EnablePillarAI:
  505.  
  506.     for(counter = 0; counter < NUMBER_OF_COMMIES_PILLAR; counter = counter + 1)
  507.     {
  508.         if(CommiePillar00[counter] != -1)
  509.         {
  510.             AISetInstinctWpntMode(CommiePillar00[counter]);
  511.         
  512.             if(counter > (NUMBER_OF_COMMIES_PILLAR - 2))   //last two commies roam
  513.             {
  514.                 AIEnableInstinct(CommiePillar00[counter], "roam", 1);
  515.             }
  516.         }
  517.     }
  518.  
  519.     return;
  520.  
  521. # ============================================================================
  522. DisablePillarAI:
  523.     
  524.     for(counter = 0; counter < NUMBER_OF_COMMIES_PILLAR; counter = counter + 1)
  525.     {
  526.         if(CommiePillar00[counter] != -1)
  527.         {
  528.             AIClearInstinctWpntMode(CommiePillar00[counter]);
  529.             
  530.             if(counter < 2)
  531.             {
  532.                 AIEnableInstinct(CommiePillar00[counter], "roam", 0);
  533.             }
  534.         }
  535.     }
  536.     
  537.     return;
  538.     
  539. # ============================================================================
  540. EnableElevAI:
  541.     
  542.     for(counter = 0; counter < NUMBER_OF_COMMIES_ELEV; counter = counter + 1)
  543.     {
  544.         if(CommieElev00[counter] != -1)
  545.         {   
  546.             AISetInstinctWpntMode(CommieElev00[counter]);
  547.             AIClearCutsceneMode(CommieElev00[counter]);
  548.             
  549. //            if(counter < 2)
  550. //            {
  551. //                AIEnableInstinct(CommieElev00[counter], "roam", 1);
  552. //                DebugPrint("Commie Roaming");
  553. //            }
  554.         }
  555.     }  
  556.     return;
  557.  
  558. # ============================================================================
  559. DisableElevAI:
  560.     
  561.     for(counter = 0; counter < NUMBER_OF_COMMIES_ELEV; counter = counter + 1)
  562.     {
  563.         if(CommieElev00[counter] != -1)
  564.         {
  565.             AIClearInstinctWpntMode(CommieElev00[counter]);
  566.             AIEnableInstinct(CommieElev00[counter], "roam", 0);
  567.             AISetCutsceneMode(CommieElev00[counter]);
  568.         }
  569.     }  
  570.     
  571.     if(AlreadyHunted == 1)
  572.     {
  573.         for(counter = 0; counter < NUMBER_COMMIES_AFTER_VOLOD; counter = counter + 1)
  574.         {
  575.             if(AfterVolodCommie0[counter] != -1)
  576.             {
  577.                 TeleportThing(AfterVolodCommie0[counter], CommieCreate0[counter]);
  578.             }
  579.         }
  580.     }
  581.     
  582.     return;    
  583.  
  584. # ============================================================================
  585. EnableLabAI:
  586.     
  587.     for(counter = 0; counter < NUMBER_OF_COMMIES_LAB; counter = counter + 1)
  588.     {
  589.         if(CommieLab00[counter] != -1)
  590.         {   
  591.             AISetInstinctWpntMode(CommieLab00[counter]);
  592.             
  593. //            if(counter >= (NUMBER_OF_COMMIES_LAB - 1))
  594. //            {
  595. //                AIEnableInstinct(CommieLab00[counter], "roam", 1);
  596. //                DebugPrint("Lab Commie Roaming");
  597. //            }                                
  598.         }
  599.     }  
  600.     return;
  601.     
  602. # ============================================================================
  603. DisableLabAI:
  604.  
  605.     for(counter = 0; counter < NUMBER_OF_COMMIES_LAB; counter = counter + 1)
  606.     {
  607.         if(CommieLab00[counter] != -1)
  608.         {
  609.             AIClearInstinctWpntMode(CommieLab00[counter]);
  610.             AIEnableInstinct(CommieLab00[counter], "roam", 0);
  611.         }
  612.     }  
  613.     
  614.     return;        
  615.     
  616. # ============================================================================
  617. //Temporarily teleports and disables the AI around the pillars if the player decides to take the wrong way back from Anubis
  618. RubbleAIOn:
  619.  
  620.     TakingRubble = 1;
  621.     
  622.     for(counter = 0; counter < NUMBER_OF_COMMIES_PILLAR; counter = counter + 1)
  623.     {
  624.         if(CommiePillar00[counter] != -1)
  625.         {
  626.             SetActorFlags(CommiePillar00[counter], 0x800);
  627.             SetActorFlags(CommiePillar00[counter], 0x400);
  628.         }
  629.     }
  630.     
  631.     if(CommiePillar04 != -1)
  632.     {
  633.         TeleportThing(CommiePillar04, RubbleTeleporter00);
  634.         AIEnableInstinct(CommiePillar04, "Roam", 0);
  635.     }
  636.     
  637.     if(CommiePillar05 != -1)
  638.     {
  639.         TeleportThing(CommiePillar05, RubbleTeleporter01);
  640.         AIEnableInstinct(CommiePillar05, "Roam", 0);
  641.     }
  642.     
  643.     
  644.     return;
  645.     
  646. # ============================================================================
  647. //ReEnables the AI around the pillars if the player decided to take the wrong way back from Anubis
  648. RubbleAIOff:
  649.     
  650.     TakingRubble = 0;
  651.     
  652.     for(counter = 0; counter < NUMBER_OF_COMMIES_PILLAR; counter = counter + 1)
  653.     {
  654.         if(CommiePillar00[counter] != -1)
  655.         {
  656.             ClearActorFlags(CommiePillar00[counter], 0x800);
  657.             ClearActorFlags(CommiePillar00[counter], 0x400);
  658.         }
  659.     }
  660.     
  661.     if(CommiePillar04 != -1)
  662.     {
  663.         AIEnableInstinct(CommiePillar04, "Roam", 1);
  664.     }
  665.     
  666.     if(CommiePillar05 != -1)
  667.     {
  668.         AIEnableInstinct(CommiePillar05, "Roam", 1);
  669.     }
  670.  
  671.  
  672.     return;
  673.  
  674. # ============================================================================
  675. MakeMainGrid:
  676.  
  677.     for(counter = 0; counter < WAYPOINT_CLEAR; counter = counter + 1)
  678.     {
  679.         AISetwpnt(TempWpnt, counter);       //Clear any waypoints that might already exist
  680.     }
  681.     
  682.     for(counter = 0; counter < WAYPOINT_TOTAL_MAIN; counter = counter + 1)
  683.     {
  684.         AISetWpnt(Wpnt00[counter], counter);    //Set ghost objects as wpnts
  685.     }
  686.     
  687.     //Grid for the forest of pillars
  688.     AIConnectWpnts(0, 1);
  689.     AIConnectWpnts(1, 2);
  690.     AIConnectWpnts(2, 3);
  691.     AIConnectWpnts(3, 4);
  692.     AIConnectWpnts(3, 8);
  693.     AIConnectWpnts(4, 7);
  694.     AIConnectWpnts(4, 5);
  695.     AIConnectWpnts(5, 6);
  696.     AIConnectWpnts(6, 7);
  697.     AIConnectWpnts(7, 8);
  698.     AIConnectWpnts(8, 9);
  699.     AIConnectWpnts(9, 10);
  700.     AIConnectWpnts(10, 11);
  701.     AIConnectWpnts(11, 12);
  702.     AIConnectWpnts(11, 19);
  703.     AIConnectWpnts(12, 13);
  704.     AIConnectWpnts(13, 14);
  705.     AIConnectWpnts(13, 15);
  706.     AIConnectWpnts(15, 16);
  707.     AIConnectWpnts(15, 17);
  708.     AIConnectWpnts(17, 18);
  709.     AIConnectWpnts(19, 20);
  710.     AIConnectWpnts(20, 21);
  711.     
  712.     AIConnectWpnts(22, 23);
  713.     AIConnectWpnts(22, 25);
  714.     AIConnectWpnts(23, 24);
  715.     AIConnectWpnts(23, 26);
  716.     AIConnectWpnts(24, 27);
  717.     AIConnectWpnts(25, 26);
  718.     AIConnectWpnts(25, 28);
  719.     AIConnectWpnts(26, 27);
  720.     //AIConnectWpnts(26, 29);
  721.     AIConnectWpnts(27, 30);
  722.     //AIConnectWpnts(28, 29);
  723.     //AIConnectWpnts(29, 30);
  724.     //AIConnectWpnts(29, 31);
  725.     //AIConnectWpnts(29, 32);
  726.     //AIConnectWpnts(29, 33);
  727.     AIConnectWpnts(30, 35);
  728.     AIConnectWpnts(31, 34);
  729.     AIConnectWpnts(32, 34);
  730.     AIConnectWpnts(33, 34);
  731.     AIConnectWpnts(34, 35);
  732.     AIConnectWpnts(34, 37);
  733.     AIConnectWpnts(35, 36);
  734.     
  735.     AIConnectWpnts(23, 38);
  736.     AIConnectWpnts(38, 39);
  737.     AIConnectWpnts(38, 40);
  738.     AIConnectWpnts(38, 41);
  739.     AIConnectWpnts(39, 40);
  740.     AIConnectWpnts(39, 42);
  741.     AIConnectWpnts(40, 41);
  742.     AIConnectWpnts(40, 42);
  743.     AIConnectWpnts(41, 42);
  744.     
  745.     return;
  746.  
  747. # ============================================================================
  748. MakeLabGrid:
  749.  
  750.     for(counter = 0; counter < WAYPOINT_CLEAR; counter = counter + 1)
  751.     {
  752.         AISetwpnt(TempWpnt, counter);       //Clear any waypoints that might already exist
  753.     }
  754.     
  755.     for(counter = 0; counter < WAYPOINT_TOTAL_LAB; counter = counter + 1)
  756.     {
  757.         AISetWpnt(LabWpnt00[counter], counter);    //Set ghost objects as wpnts
  758.     }
  759.     
  760.     AIConnectWpnts(0, 1);
  761.     AIConnectWpnts(1, 2);
  762.     AIConnectWpnts(1, 27);
  763.     AIConnectWpnts(2, 3);
  764.     AIConnectWpnts(2, 8);
  765.     AIConnectWpnts(3, 4);
  766.     AIConnectWpnts(4, 5);
  767.     AIConnectWpnts(5, 6);
  768.     AIConnectWpnts(6, 7);
  769.     AIConnectWpnts(7, 9);
  770.     AIConnectWpnts(7, 11);
  771.     AIConnectWpnts(8, 9);
  772.     AIConnectWpnts(9, 10);
  773.     AIConnectWpnts(10, 11);
  774.     AIConnectWpnts(10, 14);
  775.     AIConnectWpnts(11, 12);
  776.     AIConnectWpnts(12, 13);
  777.     AIConnectWpnts(13, 15);
  778.     AIConnectWpnts(14, 17);
  779.     AIConnectWpnts(15, 16);
  780.     AIConnectWpnts(16, 17);
  781.     AIConnectWpnts(16, 19);
  782.     AIConnectWpnts(17, 18);
  783.     AIConnectWpnts(18, 19);
  784.     AIConnectWpnts(18, 21);
  785.     AIConnectWpnts(19, 20);
  786.     AIConnectWpnts(20, 22);
  787.     AIConnectWpnts(21, 24);
  788.     AIConnectWpnts(22, 23);
  789.     AIConnectWpnts(23, 24);
  790.     AIConnectWpnts(24, 26);
  791.     AIConnectWpnts(25, 26);
  792.     AIConnectWpnts(26, 27);
  793.     
  794.     return;
  795. # ======================================================================================
  796.     
  797. end
  798.